package com.dqhl.community.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/9/19.
 * 购物车实体类
 */
public class ShopCartBean implements Serializable{
    private String  id;                //商品ID
    private String name;        //商品名称
    private String price;        //商品单价
    private int number;         //商品数量
    private int sumIntegral;
    private String pic_a;           // 商品图片
    private boolean isChoosed;      //商品是否在购物车中被选中

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public int getSumIntegral() {
        return sumIntegral;
    }

    public void setSumIntegral(int sumIntegral) {
        this.sumIntegral = sumIntegral;
    }

    public String getPic_a() {
        return pic_a;
    }

    public void setPic_a(String pic_a) {
        this.pic_a = pic_a;
    }

    public boolean isChoosed() {
        return isChoosed;
    }

    public void setChoosed(boolean choosed) {
        isChoosed = choosed;
    }
    public static boolean isAllFalse(List<Boolean> array) {
        List<Boolean> list = new ArrayList<>();
        for (int i = 0; i < array.size(); i++) {
            if (!array.get(i)) {
                list.add(array.get(i));
            }
        }
        if (list.size() == array.size()) {
            return true;
        } else {
            return false;
        }
    }

    public static boolean isAllTrue(List<Boolean> array) {
        List<Boolean> list = new ArrayList<>();
        for (int i = 0; i < array.size(); i++) {
            if (array.get(i)) {
                list.add(array.get(i));
            }
        }
        if (list.size() == array.size()) {
            return true;
        } else {
            return false;
        }
    }

    public static boolean isHaveOneFasle(List<Boolean> array) {
        List<Boolean> list = new ArrayList<>();
        for (int i = 0; i < array.size(); i++) {
            if (!array.get(i)) {
                list.add(array.get(i));
            }
        }
        if (list.size() > 0) {
            return true;
        } else {
            return false;
        }
    }

    public static boolean isHaveOneTrue(List<Boolean> array) {
        List<Boolean> list = new ArrayList<>();
        for (int i = 0; i < array.size(); i++) {
            if (array.get(i)) {
                list.add(array.get(i));
            }
        }
        if (list.size() > 0) {
            return true;
        } else {
            return false;
        }
    }

}
